package com.daxidi.cn.controller;

import com.daxidi.cn.service.IBillService;
import com.daxidi.cn.utils.ReturnResult;
import com.daxidi.cn.utils.ReturnResultUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;
@Api(tags = "收费清单模块")
@RestController
@RequestMapping("/api/v1/union/charge")
public class ChargeController {
    @Autowired
    private IBillService billService;

    @ApiOperation(value = "收费清单接口")
    @GetMapping("/{shopId}")
    public ReturnResult showBIllVosByYear(@PathVariable("shopId") Integer shopId,String time){
        String[] split = time.split("-");
        Map map = billService.showBillVosByYear(shopId, split[0], split[1]);
        return ReturnResultUtils.returnSuccess(map);
    }
}
